 <?php 

 
 $sql = "SELECT
            c.cover,
 			c.coor,
            d.title,
            s.sef_url


        
        FROM
            projects AS c,
            project_description AS d,
            project_to_category AS p2c,
            sef_url AS s
        WHERE
            p2c.project_id =  c.project_id
            AND 
            p2c.category_id = '14'
            AND 
            s.query = c.project_id

            AND

            c.project_id = d.project_id

            AND
            s.tamplate='project'

            AND

            d.lang_id = '".$_SESSION['lang_id']."'

            AND

            s.lang_id = '".$_SESSION['lang_id']."'

            AND c.published


            ORDER BY  c.order_number DESC

          ";
        $result = query($sql);
		$json = '{
  					"values": [';
        while ($row = mysql_fetch_object($result)) {
		 
		 	$coor = explode(",", $row->coor);
			$json .= '
						{
							"latitude" : "'.$coor[0].'",
							"longitude" : "'.$coor[1].'",
							"title" : "'.sth($row->title).'",
							"sef" : "'.$row->sef_url.'",
							"cover" : "'.$row->cover.'"
							
						},';

		}
$json = substr($json,0,-1);
$json .= '
			] 
				}';

echo $json;
?>